import request from '@/utils/request'
import { parseStrEmpty } from "@/utils/ruoyi";

// 分组列表查询
export function getDevGroupList(data) {
    return request({
        url: '/alm/dev_group/list',
        method: 'post',
        data: data
    })
}

// 新增分组
export function addDevGroup(data) {
    return request({
        url: '/alm/dev_group/add',
        method: 'post',
        data: data
    })
}

// 更新分组
export function editDevGroup(data) {
    return request({
        url: '/alm/dev_group/edit',
        method: 'post',
        data: data
    })
}

// 获取分组详情
export function getDevGroupDetail(devGroupId) {
    return request({
        url: '/alm/dev_group/detail/' + devGroupId,
        method: 'get'
    })
}

// 删除分组
export function delDevGroup(devGroupId) {
    return request({
        url: '/alm/dev_group/del/'+ devGroupId,
        method: 'get'
    })
}

// 获取用户设备分组键值对
export function getGroupDict(){
    return request({
        url: '/alm/dev_group/devGroupDict',
        method: 'get'
    })
}

// 获取分组下的设备信息
export function getDevInfoByGroupId(devGroupId) {
    return request({
        url: '/alm/dev_group/getDevInfoByGroupId/' + devGroupId,
        method: 'get'
    })
}